package com.open.capacity.notice.dmo;

import java.io.Serializable;
import java.util.Objects;

import com.baomidou.mybatisplus.annotation.TableName;
import com.open.capacity.notice.dto.MessageRececiverGroupDto;
import com.open.capacity.notice.enums.RececiverType;

import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * <p>
 * 接收组
 * </p>
 * @since 2024-05-07
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@TableName("msg_receciver_group")
public class MessageRececiverGroup extends AbstractSendEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "接收组名称")
	private String name;

	@ApiModelProperty(value = "接收人类型")
	@Setter(AccessLevel.PRIVATE)
	private RececiverType receciverType;
	
	@ApiModelProperty(value = "接收人个数")
	private Integer receciverCount;
	

	@ApiModelProperty(value = "备注")
	private String remark;
	
	public MessageRececiverGroup(MessageRececiverGroupDto messageRececiverGroupDto) {
		if (Objects.nonNull(messageRececiverGroupDto)) {
			setId(messageRececiverGroupDto.getId());
			setName(messageRececiverGroupDto.getName()); 
			setRececiverType(messageRececiverGroupDto.getRececiverType());
			setRemark(messageRececiverGroupDto.getRemark()); 
		}
	}
 
}
